Step 2: RequestCreateOrder
Create Order is an interface provided to merchants to submit a pre-order with brief transaction information provided, such as a short code, merchant order ID, order amount, etc. In the subscription payment scenario, the mandate information should be submitted. The interface will respond with a prepayId, which is necessary to evoke the checkout page. The contract details will be shown on the checkout page when the pre-order is for a subscription payment business.
Quick Step on create order:
The Merchant Server sends a request with payment details to create an order, including mandate or subscription payment information.
The Merchant Server receives an order ID after successfully creating the order, which opens the checkout page in the Mobile Money Customer App.
Customer enters their PIN and sends a payment request.
The App Server invokes the payOrder interface to process the payment and create a mandate contract.
The Order Service notifies the merchant server in the background about the result of the contract signing.
Note
The price at which the fee is deducted in create order must align with the specified price determined by the system (SP poral).
Create apply Request Create Order service
Create a file at API\service\requestCreateOrderService.js
:
INSERT CODE HERE
// module.exports = createOrder;
Request Parameters
HEADER PARAMETERS
Parameter | Data Type | M/O | Description |
---|---|---|---|
X-APP-Key | String | M | Fabric App ID, provided by fabric portal of Ethio telecom |
Authorization | String | M | App Token for authentication |
REQUEST BODY SCHEMA
Parameter | Data Type | M/O | Description |
---|---|---|---|
timestamp | string | M | <= 13 characters ^[0-9][1-9][0-9]$ |
Time when a request is sent. UTC timestamp. The unit is second | |||
method | string | M | Set to ‘payment.preorder’, fixed for this interface |
-payment.preorder | |||
nonce_str | string | M | <= 256 characters [\w-]+ |
Random character string containing a maximum of 256 characters,including uppercase letters, lowercase letters, digits, but not specialcharacters | |||
sign_type | string | M | Signature type. Currently, HmacSHA256 and SHA256WithRSA aresupported." |
enum: | |||
#VALUE! | |||
#VALUE! | |||
#VALUE! | |||
sign | String | M | <= 512 characters \S+ |
Request signature. | |||
BC4EE8D710BAC6A7E33DE4511A1CE7723 | |||
024615EEF491B80DEF7DC743D4DADBE | |||
version | String | M | <= 4 characters [0-9.]* |
Interface version number. Only support 1.0 now | |||
M | |||
biz_content | Multiple mandate objects | ||
notify_url | String | M | <= 512 characters |
redirect_url | String | <= 512 characters | |
appid | String | M | <= 32 characters ^[A-Za-z0-9]+$ |
APP ID of the Mandate order | |||
This field is entered when a mandating order is created. | |||
merch_code | String | M | <= 16 characters ^[A-Za-z0-9]+$ |
Application ID allocated to a merchant by Mobile Payment systemmerch_order_id | |||
The order number generated by the merchant side. It must bein the form of letters, numbers, and underscores. Other special characters are not allowed | |||
trade_type | String | Trade type. The option are InApp、Cross-App、Checkout、WebCheckout、PWA、QrCode、NativeApp" | |
enum: | |||
InApp | |||
Cross-App | |||
Checkout | |||
WebCheckout | |||
PWA | |||
QrCode | |||
NativeApp | |||
BankTrade | |||
“Mandate” | |||
title | String | M | <= 512 characters |
total_amount | String | M | <= 20 characters |
trans_currency | String | M | <= 3 characters \w+ |
Three-letter code complying with international standards, for example, MMK (Kyat) | |||
timeout_express | String | M | <= 10 characters [0-9]*m$ |
Latest payment time allowed for an order. The transaction will be closed after the deadline. The value ranges from 1 minute to 120 minutes.The value of this parameter cannot contain dots. For example, the value1.5 hours must be converted to 90 minutes. If this parameter is not set,120 minutes is used by default | |||
business_type | String | example: "Buy goods" | |
business type | |||
maxLength: 32 | |||
pattern: "[\s\w-]*" | |||
payee_identifier | String | example: "1563161657" | |
payee identifier" | |||
pattern: "^[A-Za-z0-9]*$" | |||
payee_identifier_type | String | example: "01" | |
payee identifier type | |||
pattern: "[0-9]*" | |||
payee_type | String | example: "1000" | |
payee type | |||
pattern: "[0-9]*" | |||
callback_info | String | After the payment is successful, Payment will notify the merchant server of the callback request to return this field as it is, and the merchant can pass the business parameters according to its own needs. Must be in URL encoding format. | |
maxLength: 64 | |||
pattern: "[\s\w-%]*" | |||
note | String | example: "hello" | |
note | |||
maxLength: 256 | |||
pattern: "[\s\w-]*" | |||
operator_id | String | example: "0000" | |
Operator ID | |||
maxLength: 128 | |||
pattern: "^[A-Za-z0-9]+$" | |||
mandate_data | String | M | mandate data |
remain_days | String | ||
pattern: "^[1-9] | |||
sub_identifier | String | maxLength: 32 | |
pattern: "^[A-Za-z0-9]+$" |
Response Parameters
Parameter | Data Type | M/O | Description |
---|---|---|---|
result | String | example: "SUCCESS" | |
SUCCESS or FAIL. When this field is FAIL, the code field is a specific business error code. | |||
code | String | example: "0" | |
Return code. 0 is successful, the rest is the business error code | |||
msg | String | example: "Success" | |
Return information, simple error description. | |||
nonce_str | String | example: "274E40E9388047778768B67068B9C8AF" | |
Random character string. 256 characters or fewer. | |||
maxLength: 256 | |||
sign | String | M | example: "BC4EE8D710BAC6A7E33DE4511A1CE772 |
3024615EEF491B80DEF7DC743D4DADBE" | |||
Specifies a signature. | |||
maxLength: 512 | |||
sign_type | String | Signature type. Currently, HmacSHA256 and SHA256WithRSA are supported. | |
enum: | |||
#VALUE! | |||
#VALUE! | |||
biz_content | M | ||
merch_order_id | String | M | example: "201907161732001" |
The order number generated by the merchant side. It must be in the form of letters, numbers, and underscores. Other special characters are not allowed. | |||
maxLength: 64 | |||
pattern: "^[A-Za-z0-9]+$" | |||
prepay_id | String | example: "007a6bd3175cdb3c658545a4f3f85fac23143239021" | |
ID of the customer payment process.When return_code is SUCCESS,this value will return | |||
maxLength: 128 | |||
pattern: "^[A-Za-z0-9]+$" | |||
qrcode | String | example: "1801208886097590927019026" | |
This parameter is valid only when trade_type is set to PAY_BY_QRCODE during order placement. | |||
maxLength: 128 | |||
pattern: "^[A-Za-z0-9]+$" | |||
errorCode | String | ||
errorMsg | String |